/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author YDZ
 */
import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { BasicModel, Page } from '../model/baseModel';

const { adminPath } = useGlobSetting();

export interface PmWatermeter extends BasicModel<PmWatermeter> {
  createDate?: string; // 创建时间
  name?: string; // 项目名称
  projectno?: string; // 工程编号
  picno?: string; // picno
  checkresult?: string; // 申请结果
  perno?: string; // 安装人编号
  pername?: string; // 安装人名称
  installtime?: string; // 申请挂表时间
  gbresult?: string; // 验收结果
  picno2?: string; // picno2
  picno3?: string; // picno3
}

export const pmWatermeterList = (params?: PmWatermeter | any) =>
  defHttp.get<PmWatermeter>({ url: adminPath + '/process/meter/pmWatermeter/list', params });

export const pmWatermeterListData = (params?: PmWatermeter | any) =>
  defHttp.post<Page<PmWatermeter>>({
    url: adminPath + '/process/meter/pmWatermeter/listData',
    params,
  });

export const pmWatermeterForm = (params?: PmWatermeter | any) =>
  defHttp.get<PmWatermeter>({ url: adminPath + '/process/meter/pmWatermeter/form', params });

export const pmWatermeterSave = (params?: any, data?: PmWatermeter | any) =>
  defHttp.postJson<PmWatermeter>({
    url: adminPath + '/process/meter/pmWatermeter/save',
    params,
    data,
  });

export const pmWatermeterDelete = (params?: PmWatermeter | any) =>
  defHttp.get<PmWatermeter>({ url: adminPath + '/process/meter/pmWatermeter/delete', params });

// 刷新表务日志
export const pmWatermeterRefreshLog = (params?: PmWatermeter | any) =>
  defHttp.get<PmWatermeter>({ url: adminPath + '/process/meter/pmWatermeter/refreshLog', params });
